# 第一阶段构建
FROM debian:13.2-slim AS builder
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources && \
apt-get -y update && apt-get -y install wget && \
wget -P /usr/local/minio  https://dl.min.io/server/minio/release/linux-amd64/minio  && \
wget -P /usr/local/minio  https://dl.min.io/client/mc/release/linux-amd64/mc  && \
chmod +x /usr/local/minio/minio && chmod +x /usr/local/minio/mc
# 第二阶段
FROM debian:13.2-slim
LABEL author=xiaoyilin
LABEL email=406735078@qq.com
ENV TZ=Asia/Shanghai
ENV PATH=$PATH:/usr/local/minio
ENV MINIO_ROOT_USER=xiaoyilin
COPY --from=builder /usr/local/minio /usr/local/minio
ENTRYPOINT ["minio","server","--console-address=:9001"]
CMD ["/usr/local/minio/data"]

# https://github.com/minio/minio
# https://github.com/minio/mc
# docker build -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/minio:20250907 .
# docker run -p 9000-9001:9000-9001 --rm -e MINIO_ROOT_PASSWORD=xiaoyilin registry.cn-hangzhou.aliyuncs.com/xiaoyilin/minio:20250907
# docker run -it --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/minio:20250907 bash
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/minio:20250907